import { LAYOUT } from '@/router/constant'
import { MICRO_APP_BASE_ROUTER } from '@/enums/microApp'

import type { AppRouteModule } from '@/router/types'

const RedirectBase: AppRouteModule = {
    path: import.meta.env.VITE_PUBLIC_PATH + `/${MICRO_APP_BASE_ROUTER}`,
    name: 'MICRO_APP_BASE',
    component: LAYOUT,
    meta: {
        isLayout: false,
        hideMenu: true,
        icon: 'about-dot-me',
        title: 'MICRO_BASE'
    },
    children: [
        {
            path: import.meta.env.VITE_PUBLIC_PATH + `/${MICRO_APP_BASE_ROUTER}/:pathMatch(.*)*`,
            name: 'RESOURCES_BASE',
            component: () => import('@/views/system/MicroAppContainer.vue'),
            meta: {
                title: '资源菜单',
                icon: 'about-dot-me',
                hideMenu: true
            }
        },
        {
            path:
                import.meta.env.VITE_PUBLIC_PATH +
                `/${MICRO_APP_BASE_ROUTER}/allin-data-governance-web/:pathMatch(.*)*`,
            name: 'GOVERNANCE_BASE',
            component: () => import('@/views/system/MicroAppContainer.vue'),
            meta: {
                title: '大数据治理',
                icon: 'about-dot-me',
                hideMenu: true
            }
        },
        {
            path:
                import.meta.env.VITE_PUBLIC_PATH +
                `/${MICRO_APP_BASE_ROUTER}/allin-data-visualization-web/:pathMatch(.*)*`,
            name: 'VISUALIZATION_BASE',
            component: () => import('@/views/system/MicroAppContainer.vue'),
            meta: {
                title: '可视化大屏',
                icon: 'about-dot-me',
                hideMenu: true
            }
        },
        {
            path:
                import.meta.env.VITE_PUBLIC_PATH +
                `/${MICRO_APP_BASE_ROUTER}/adv/:pathMatch(.*)*`,
            name: 'VISUALIZATION_BASE_REF',
            component: () => import('@/views/system/MicroAppViteContainer.vue'),
            meta: {
                title: '可视化大屏',
                icon: 'about-dot-me',
                hideMenu: true
            }
        },
        {
            path:
                import.meta.env.VITE_PUBLIC_PATH + `/${MICRO_APP_BASE_ROUTER}/allin-data-analysis-web/:pathMatch(.*)*`,
            name: 'ANALYSIS_BASE',
            component: () => import('@/views/system/MicroAppContainer.vue'),
            meta: {
                title: '数据分析',
                icon: 'about-dot-me',
                hideMenu: true
            }
        },
        {
            path: import.meta.env.VITE_PUBLIC_PATH + `/customPage`,
            name: 'CUSTOM_BASE',
            component: () => import('@/views/system/CustomPage.vue'),
            meta: {
                title: 'SYSTEM_MENU_CUSTOM_PAGE',
                icon: 'about-dot-me',
                hideMenu: true
            }
        }
    ]
}

export default RedirectBase

// data-analysis-web
